#!/usr/bin/env python
import os

configs = {
		'db': {
			'host': '192.168.50.110',
			'user': 'yoxnet',
			'password': 'yoxnet',
			'database': 'yoxnet_idc',
			'raise_on_warnings': True
		},
		'redis': {
			'host': '192.168.50.111',
			'db': 1,
			'password': 'redis',
			'max_connections': 5
		},
		'workspace': os.path.dirname(__file__),
		'log': {
			"version": 1,
    		"formatters": {
        		"simple": {
            		"format": "%(levelname)-8s - %(message)s"
        		},
        		'file_formatter': {
        			"format": "%(asctime)s:%(levelname)-8s - %(message)s"
        		}
    		},
			"handlers": {
				"stdout": {
					"class": "logging.StreamHandler",
					"level": "DEBUG",
					"formatter": "simple",
					"stream": "ext://sys.stdout"
				},
				"stderr": {
					"class": "logging.StreamHandler",
					"level": "ERROR",
					"formatter": "simple",
					"stream": "ext://sys.stderr"
				},
				"file": {
					"class": "logging.handlers.RotatingFileHandler",
					"formatter": "file_formatter",
					"level": "DEBUG",
					"filename": os.path.dirname(__file__) + "/log/app.log",
					#"mode": "a",
					"maxBytes" : 10*1024*1024,
					"backupCount": 10

				}
			},
			"root": {
        		"level": "DEBUG",
        		"handlers": [
            		#"stderr",
            		"stdout",
            		#"file"
        		]
    		}
		}
	}



try:
    import config_override
    configs = {**configs, **config_override.configs}
except ImportError:
    pass
except AttributeError:
	pass
